import request from '@/utils/request';

// 刷新字典缓存
export function refreshCache() {
  return request({
    url: '/system/dictType/refreshCache',
    method: 'delete',
  });
}

// 查询字典类型详细
export function getDictType(id) {
  return request({
    url: '/system/dictType/queryById/' + id,
    method: 'get',
  });
}

// 查询字典类型列表
export function listDictType(query) {
  return request({
    url: '/system/dictType/pageList',
    method: 'get',
    params: query,
  });
}

// 查询已发布的字典类型列表
export function queryRelease(params) {
  return request({
    url: '/system/dictType/queryRelease',
    method: 'get',
    params,
  });
}

// 查询逻辑删除的字典类型列表
export function queryRecycle(params) {
  return request({
    url: '/system/dictType/queryRecycle',
    method: 'get',
    params,
  });
}

// 新增字典类型
export function addDictType(data) {
  return request({
    url: '/system/dictType/insert',
    method: 'post',
    data: data,
  });
}

// 修改字典类型
export function updateDictType(data) {
  return request({
    url: '/system/dictType/updateById',
    method: 'put',
    data: data,
  });
}

// 根据id批量审核
export function auditByIds(ids) {
  return request({
    url: '/system/dictType/auditByIds/' + ids,
    method: 'put',
  });
}

// 根据id批量反审核
export function unauditByIds(ids) {
  return request({
    url: '/system/dictType/unauditByIds/' + ids,
    method: 'put',
  });
}
// 导出当前查询列表
export function exports(params) {
  return request({
    url: '/system/dictType/export',
    method: 'post',
    params,
  });
}

// 删除字典类型
export function delDictType(ids) {
  return request({
    url: '/system/dictType/deleteByIds/' + ids,
    method: 'delete',
  });
}

// 根据id批量还原删除的字典类型
export function recoverByIds(ids) {
  return request({
    url: '/system/dictType/recoverByIds/' + ids,
    method: 'put',
  });
}
// 根据id批量逻辑删除字典类型
export function removeByIds(ids) {
  return request({
    url: '/system/dictType/removeByIds/' + ids,
    method: 'delete',
  });
}
